package com.neuronrobotics.aim.gui;

import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;

import javax.swing.JButton;
import javax.swing.JLabel;
import javax.swing.JPanel;

import javax.swing.JTextField;

import net.miginfocom.swing.MigLayout;
import java.awt.Font;
import java.awt.Color;


public class JointJoggingPanel extends JPanel implements ActionListener {
	private static final long serialVersionUID = 1L;
	private final JButton buttonResetX = new JButton("Reset");
	private final JButton buttonResetY = new JButton("Reset");
	private final JButton buttonResetZ = new JButton("Reset");
	private final JButton buttonResetInsertion = new JButton("Reset");
	private final JButton buttonResetRotation = new JButton("Reset");
	private final JButton buttonResetRetraction = new JButton("Reset");
	private final JLabel lblStageXAxis = new JLabel("Stage X Axis");
	private final JLabel lblStageYAxis = new JLabel("Stage Y Axis");
	private final JLabel lblStageZAxis = new JLabel("Stage Z Axis");
	private final JLabel lblInsertion = new JLabel("Insertion Axis");
	private final JLabel lblRotationAxis = new JLabel("Rotation Axis");
	private final JLabel lblRetractionAxis = new JLabel("Retraction Axis");
	private final JButton buttonJogPlusX = new JButton("Jog+");
	private final JTextField textFieldXAxisDesiredJointPosition = new JTextField();
	private final JButton buttonJogMinusX = new JButton("Jog-");
	private final JTextField textFieldYAxisDesiredJointPosition = new JTextField();
	private final JTextField textFieldZAxisDesiredJointPosition = new JTextField();
	private final JTextField textFieldInsertionDesiredJointPosition = new JTextField();
	private final JTextField textFieldRotationDesiredJointPosition = new JTextField();
	private final JTextField textFieldRetractionDesiredJointPosition = new JTextField();
	private final JButton buttonJogPlusY = new JButton("Jog+");
	private final JButton buttonJogPlusZ = new JButton("Jog+");
	private final JButton buttonJogPlusInsertion = new JButton("Jog+");
	private final JButton buttonJogPlusRotation = new JButton("Jog+");
	private final JButton buttonJogPlusRetraction = new JButton("Jog+");
	private final JButton buttonJogMinusY = new JButton("Jog-");
	private final JButton buttonJogMinusZ = new JButton("Jog-");
	private final JButton buttonJogMinusInsertion = new JButton("Jog-");
	private final JButton buttonJogMinusRotation = new JButton("Jog-");
	private final JButton buttonJogMinusRetraction = new JButton("Jog-");
	private final JTextField textField = new JTextField();
	private final JLabel label = new JLabel("mm/deg");
	private final JLabel labelProstateRobot = new JLabel("Prostate Robot Jogging");
	private final JLabel lblActiveCannulaRobot = new JLabel("Active Cannula Robot Jogging");
	private final JButton button = new JButton("Reset");
	private final JButton button_1 = new JButton("Reset");
	private final JButton button_2 = new JButton("Reset");
	private final JButton button_3 = new JButton("Reset");
	private final JLabel label_1 = new JLabel("Stage X Axis");
	private final JLabel label_2 = new JLabel("Stage X Axis");
	private final JLabel label_3 = new JLabel("Stage X Axis");
	private final JLabel label_4 = new JLabel("Stage X Axis");
	private final JTextField textField_1 = new JTextField();
	private final JTextField textField_2 = new JTextField();
	private final JTextField textField_3 = new JTextField();
	private final JTextField textField_4 = new JTextField();
	private final JTextField textField_5 = new JTextField();
	private final JButton button_4 = new JButton("Jog+");
	private final JButton button_5 = new JButton("Jog+");
	private final JButton button_6 = new JButton("Jog+");
	private final JButton button_7 = new JButton("Jog+");
	private final JLabel label_5 = new JLabel("mm/deg");
	private final JButton button_8 = new JButton("Jog-");
	private final JButton button_9 = new JButton("Jog-");
	private final JButton button_10 = new JButton("Jog-");
	private final JButton button_11 = new JButton("Jog-");
	
	public JointJoggingPanel(MainGUI kinematicsGUI) {

		setLayout(new MigLayout("", "[][][][][]", "[][][][][][][][][][][][][][][][]"));
		labelProstateRobot.setForeground(Color.BLACK);
		
		add(labelProstateRobot, "cell 0 0 5 1");
		textField.setText("1");
		textField.setColumns(10);
		
		add(textField, "cell 3 1,growx");
		
		add(label, "cell 4 1");
		
		add(buttonResetX, "cell 0 2");
		lblStageXAxis.setForeground(Color.BLUE);
		lblStageXAxis.setFont(new Font("Tahoma", Font.BOLD, 11));
		
		add(lblStageXAxis, "cell 1 2,alignx left");
		textFieldXAxisDesiredJointPosition.setText("0");
		textFieldXAxisDesiredJointPosition.setColumns(10);
		
		add(textFieldXAxisDesiredJointPosition, "cell 2 2,growx");
		
		add(buttonJogPlusX, "cell 3 2");
		
		add(buttonJogMinusX, "cell 4 2");
		
		add(buttonResetY, "cell 0 3");
		lblStageYAxis.setForeground(Color.BLUE);
		lblStageYAxis.setFont(new Font("Tahoma", Font.BOLD, 11));
		
		add(lblStageYAxis, "cell 1 3,alignx left");
		textFieldYAxisDesiredJointPosition.setText("0");
		textFieldYAxisDesiredJointPosition.setColumns(10);
		
		add(textFieldYAxisDesiredJointPosition, "cell 2 3,growx");
		
		add(buttonJogPlusY, "cell 3 3");
		
		add(buttonJogMinusY, "cell 4 3");
		
		add(buttonResetZ, "cell 0 4");
		lblStageZAxis.setForeground(Color.BLUE);
		lblStageZAxis.setFont(new Font("Tahoma", Font.BOLD, 11));
		
		add(lblStageZAxis, "cell 1 4,alignx left");
		textFieldZAxisDesiredJointPosition.setText("0");
		textFieldZAxisDesiredJointPosition.setColumns(10);
		
		add(textFieldZAxisDesiredJointPosition, "cell 2 4,growx");
		
		add(buttonJogPlusZ, "cell 3 4");
		
		add(buttonJogMinusZ, "cell 4 4");
		
		add(buttonResetInsertion, "cell 0 5");
		lblInsertion.setForeground(Color.BLUE);
		lblInsertion.setFont(new Font("Tahoma", Font.BOLD, 11));
		
		add(lblInsertion, "cell 1 5,alignx left");
		textFieldInsertionDesiredJointPosition.setText("0");
		textFieldInsertionDesiredJointPosition.setColumns(10);
		
		add(textFieldInsertionDesiredJointPosition, "cell 2 5,growx");
		
		add(buttonJogPlusInsertion, "cell 3 5");
		
		add(buttonJogMinusInsertion, "cell 4 5");
		
		add(buttonResetRotation, "cell 0 6");
		lblRotationAxis.setForeground(Color.BLUE);
		lblRotationAxis.setFont(new Font("Tahoma", Font.BOLD, 11));
		
		add(lblRotationAxis, "cell 1 6,alignx left");
		textFieldRotationDesiredJointPosition.setText("0");
		textFieldRotationDesiredJointPosition.setColumns(10);
		
		add(textFieldRotationDesiredJointPosition, "cell 2 6,growx");
		
		add(buttonJogPlusRotation, "cell 3 6");
		
		add(buttonJogMinusRotation, "cell 4 6");
		
		add(buttonResetRetraction, "cell 0 7");
		lblRetractionAxis.setForeground(Color.BLUE);
		lblRetractionAxis.setFont(new Font("Tahoma", Font.BOLD, 11));
		
		add(lblRetractionAxis, "cell 1 7,alignx left");
		textFieldRetractionDesiredJointPosition.setText("0");
		textFieldRetractionDesiredJointPosition.setColumns(10);
		
		add(textFieldRetractionDesiredJointPosition, "cell 2 7,growx");
		
		add(buttonJogPlusRetraction, "cell 3 7");
		
		add(buttonJogMinusRetraction, "cell 4 7");
		
		add(lblActiveCannulaRobot, "cell 0 9");
		textField_5.setText("1");
		textField_5.setColumns(10);
		
		add(textField_5, "cell 3 11,growx");
		
		add(label_5, "cell 4 11");
		
		add(button, "cell 0 12");
		label_1.setForeground(Color.BLUE);
		label_1.setFont(new Font("Tahoma", Font.BOLD, 11));
		
		add(label_1, "cell 1 12,alignx trailing");
		textField_1.setText("0");
		textField_1.setColumns(10);
		
		add(textField_1, "cell 2 12,growx");
		
		add(button_4, "cell 3 12");
		
		add(button_8, "cell 4 12");
		
		add(button_1, "cell 0 13");
		label_2.setForeground(Color.BLUE);
		label_2.setFont(new Font("Tahoma", Font.BOLD, 11));
		
		add(label_2, "cell 1 13,alignx trailing");
		textField_2.setText("0");
		textField_2.setColumns(10);
		
		add(textField_2, "cell 2 13,growx");
		
		add(button_5, "cell 3 13");
		
		add(button_9, "cell 4 13");
		
		add(button_2, "cell 0 14");
		label_3.setForeground(Color.BLUE);
		label_3.setFont(new Font("Tahoma", Font.BOLD, 11));
		
		add(label_3, "cell 1 14,alignx trailing");
		textField_3.setText("0");
		textField_3.setColumns(10);
		
		add(textField_3, "cell 2 14,growx");
		
		add(button_6, "cell 3 14");
		
		add(button_10, "cell 4 14");
		
		add(button_3, "cell 0 15");
		label_4.setForeground(Color.BLUE);
		label_4.setFont(new Font("Tahoma", Font.BOLD, 11));
		
		add(label_4, "cell 1 15,alignx trailing");
		textField_4.setText("0");
		textField_4.setColumns(10);
		
		add(textField_4, "cell 2 15,growx");
		
		add(button_7, "cell 3 15");
		
		add(button_11, "cell 4 15");
		
	}

	@Override
	public void actionPerformed(ActionEvent act) {
			
	}
}
